package bod;

public class Job {

	private String		name;
	private int			work;
	private int			done;
	private Runnable	run;

	public Job(String name, int work, Runnable run) {
		this.name = name;
		this.work = work;
		this.done = 0;
		this.run = run;
	}

	public String getName() {
		return this.name;
	}

	public int getWork() {
		return this.work;
	}

	public boolean isBusy() {
		return this.done < this.work;
	}

	public int getDone() {
		return this.done;
	}

	public void done(int done) {
		this.done += done;
	}

	public void start() {
		new Thread(this.run).start();
	}

}